<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\News
 *
 * @property int $id
 * @property string $title
 * @property string $pic
 * @property string|null $content
 * @property int $sort
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereContent($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News wherePic($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereSort($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property int $menu_id
 * @property int $isShow
 * @property-read \App\Models\Menu $menu
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereIsShow($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\News whereMenuId($value)
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\NewsExtra[] $extra
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\NewGallery[] $gallery
 */
class News extends Model
{
    protected $table = 'cms_news';
    public function menu(){
        return $this->belongsTo(Menu::class);
    }
    public function gallery(){
        return $this->hasMany(NewGallery::class);
    }
    public function extra(){
        return $this->hasMany(NewsExtra::class);
    }
}
